package com.taobao.pet.controller;
import com.taobao.basic.annotation.PreAuthorize;
import com.taobao.basic.util.JsonResult;
import com.taobao.basic.util.PageList;
import com.taobao.org.domain.Department;
import com.taobao.pet.domain.Pet;
import com.taobao.pet.domain.PetType;
import com.taobao.pet.query.PetQuery;
import com.taobao.pet.service.IPetService;
import com.taobao.pet.service.IPetTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController // controller层，返回json格式数据
@RequestMapping("/petType")
@Api(value = "宠物接口类",description = "宠物接口的CRUD操作")
public class PetTypeController {

    @Autowired
    private IPetTypeService PetTypeService;

    @GetMapping("/typeTree")
    @PreAuthorize(name = "部门树",sn = "petType:tree" ) // value后面用来做校验权限
    public  List<PetType> typeTree(){

        return PetTypeService.typeTree();
    };
}
